package com.qf.frist;

import org.quartz.Job;
import org.quartz.JobDetail;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;

import java.util.Date;

/**
 * @author Ypl
 * @version V1.0
 * @Project September-mavens
 * @Package com.qf.frist
 * @Description:
 * @Date 2022/10/8 17:33
 */
@SuppressWarnings("all")
public class Quartz implements Job {
    /**
     * 定义要任务器实现的事情
     * @param context
     * @throws JobExecutionException
     */
    @Override
    public void execute(JobExecutionContext context) throws JobExecutionException {
//        创建工作详情
        JobDetail jobDetail = context.getJobDetail();
        //工作名称
        String name = jobDetail.getKey().getName();//任务名
        String group = jobDetail.getKey().getGroup();//任务group
//        System.out.println("job执行,job:"+name+"group:"+group);
        System.out.println(new Date());
    }
}
